import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import vitePluginUniRouter from "./src/uni-simple-router/compiler";
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vitePluginUniRouter({
      pluginPath: `./uni-simple-router`,
    }),
    uni(),
  ],
  server: {
    //open: !0, //vite项目启动时自动打开浏览器
    hmr: !0, //开启热更新，vite开发环境默认是关闭热更新的
    port: 9527,
    host: true,
    proxy: {
      "/ajax": {
        target: "http://192.168.144.157:8090",
        changeOrigin: !0,
        rewrite: (path) => path.replace(/^\/ajax/, ""),
      },
	  "/mobilePath": {
	    target: "http://192.168.144.157:8090",
	    changeOrigin: !0,
	    // rewrite: (path) => path.replace(/^\/ajax/, ""),
	  },
    },
  },
});
